﻿using UnityEngine;
using System.Collections;

public class ShotgunBullet : MonoBehaviour
{
    float distanceTravelled = 0;
    Vector3 lastPosition;

    void Start()
    {
        lastPosition = transform.position;
    }

    void Update()
    {
        distanceTravelled += Vector3.Distance(transform.position, lastPosition);
        lastPosition = transform.position;

        if (distanceTravelled > 0.8f)
            Destroy(this.gameObject);
    }
}
